package com.hck.taozi_help.module.main.jsfunction;

import android.content.Context;
import android.webkit.JavascriptInterface;

import com.hck.taozi_help.module.yuyin.KeDaYuYingPlayVoice;
import com.hck.taozi_help.utils.LogUtil;

public class MainWebViewJs extends Object{
    public static final String APP="Android";
    private Context mContext;
    public MainWebViewJs(Context context){
        mContext=context;
    }
    private KeDaYuYingPlayVoice keDaYuYingPlayVoice;
    @JavascriptInterface
    public void playVoice(String text) {
        if (keDaYuYingPlayVoice==null){
            keDaYuYingPlayVoice=new KeDaYuYingPlayVoice();
        }
        LogUtil.log("收到網頁數據: "+text);
        keDaYuYingPlayVoice.playVoice(mContext,text);
    }
}
